package com.easyadmin.modules.sys.controller;

import com.easyadmin.common.web.base.BaseController;
import com.easyadmin.common.web.domain.response.Result;
import com.easyadmin.modules.sys.service.HomeService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 订单派单记录Controller
 *
 * @author mars
 * @date 2025-02-11
 */
@Api(tags = {"首页统计"})
@RestController
@RequestMapping("/sys/stats")
@AllArgsConstructor
public class HomeStatsController extends BaseController {


    private final HomeService homeService;

    /**
     * 首页统计
     */
    @GetMapping("/homeStats")
    public Result homeStats() {
        return success(homeService.homeStats());
    }

    /**
     * 首页统计按照范围
     */
    @GetMapping("/getOrderCountByDateRange")
    public Result getOrderCountByDateRange(Integer days) {
        return success(homeService.getOrderCountByDateRange(days));
    }


}
